package cn.youframe.frame.ctrl;

import java.util.Enumeration;
import java.util.Vector;

/**
 * User: Administrator
 * DateTime: 13-2-10: 下午10:54
 */
public class UserList {
    private static final UserList userList = new UserList();
    private Vector v = new Vector();
    private UserList(){
        //v = new Vector();
    }
    public static UserList getInstance(){
        return userList;
    }
    public void addUser(Object dlid){
        v.addElement(dlid);
    }
    public boolean IsExist(Object dlid){
        try{
            if (v.indexOf(dlid) >= 0)
                return true;
            return false;
        }catch(Exception ex){
            return false;
        }
    }
    public void RemoveUser(Object dlid){
        v.removeElement(dlid);
    }
    //返回Vector枚举
    public Enumeration getUserList(){
        return v.elements();
    }
    //返回在线人数
    public int getUserCount(){
        return v.size();
    }
}
